package com.example.demo.account.service;

import com.example.demo.account.entity.SysUser;
import com.example.demo.account.entity.SysUserRole;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author littlecar
 * @date 2020/3/16 14:26
 */
public interface UserRoleService {

    SysUserRole findById(Long id);

    Map<Long, String> combineUserRoles(List<SysUserRole> sysUserRoles);

    void save(SysUserRole userRole);

    List<SysUserRole> findByUserId(Long id);

    Map<Long, List<SysUserRole>> findMapByUserId(Long id);

    void delete(SysUserRole s);

    void deleteAll(List<SysUserRole> sysUserRoles);

    void deteleByUserIdAndRoleId(Long user_id, Long role_id);

    List<SysUserRole> findByUserIdAndRoleId(Long userId, Long roleId);

    List<SysUserRole> findAllSchoolAdmin();

    void updateSchoolId(Long user_id, Long school_id, Long role_id);

    List<Long> findUserIdBySchoolIdAndRoleId(Long school_id, Long role_id);

    SysUserRole findOneByUserIdAndRoleId(Long user_id, Long role_id);

    SysUserRole findByUserIdAndRoleIdAndSchoolId(Long user_id, Long role_id, Long school_id);

    void deleteByUserIdAndRoleIdAndSchoolId(Long user_id, Long role_id, Long school_id);
}
